/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package util.components;

import javax.swing.JComboBox;

/**
 *
 * @author Raul
 */
public class DocumentoPnl extends javax.swing.JPanel {
    
    /**
     * Creates new form DocumentoPnl
     */
    public DocumentoPnl() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel7 = new javax.swing.JLabel();
        tipoDniCmb = new javax.swing.JComboBox();
        jLabel11 = new javax.swing.JLabel();
        numeroDniTxt = new util.components.IntegerTextField();

        setBorder(javax.swing.BorderFactory.createTitledBorder("Documento"));

        jLabel7.setText("Tipo Documento");

        tipoDniCmb.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "", "DNI", "LC", "LE", "PAS" }));

        jLabel11.setText("Nro Documento");

        numeroDniTxt.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                numeroDniTxtKeyTyped(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel7)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(tipoDniCmb, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel11)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(numeroDniTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tipoDniCmb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7)
                    .addComponent(jLabel11)
                    .addComponent(numeroDniTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 8, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void numeroDniTxtKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_numeroDniTxtKeyTyped
        //Restringe el numero de maximo de caracteres a ingresar a 8.
        if (numeroDniTxt.getText().length() == 8) evt.consume();
    }//GEN-LAST:event_numeroDniTxtKeyTyped

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel7;
    private util.components.IntegerTextField numeroDniTxt;
    private javax.swing.JComboBox tipoDniCmb;
    // End of variables declaration//GEN-END:variables

    public IntegerTextField getNumeroDniTxt() {
        return numeroDniTxt;
    }

    public JComboBox getTipoDniCmb() {
        return tipoDniCmb;
    }
}
